<?php
/**
 * Created by PhpStorm.
 * User: alexey
 * Date: 8/17/14
 * Time: 4:53 PM
 */

function facebookShare($title, $description, $icon ) {
  $title=urlencode($title);
  $url=urlencode("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
  $summary=urlencode($description);
  $image=urlencode($icon);
  $result = "window.open('http://www.facebook.com/sharer/sharer.php?s=100&amp;p[title]=".$title."&amp;p[summary]=".$summary."&amp;p[url]=".$url."&amp;p[images][0]=".$image."','sharer','toolbar=0,status=0,width=700,height=400');";
  return $result;
}